import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    // 登录
    {
        path: '/',
        name: 'login',
        component: () => import('../view/login.vue')
    },
    // 路由
    {
        path: '/base',
        name: 'base',
        component: () => import('../components/layout.vue'),
        children: [
            {
                path: 'home',
                name: 'home',
                component: () => import('../view/home/index.vue')
            },
            {
                path: 'list',
                name: 'list',
                component: () => import('../view/list/index.vue')
            },
            {
                path: 'user',
                name: 'user',
                component: () => import('../view/user/index.vue')
            },
            {
                path: 'forum',
                name: 'forum',
                component: () => import('../view/forum/index.vue')
            },
            {
                path: 'post',
                name: 'post',
                component: () => import('../view/post/index.vue')
            },
            {
                path: 'category',
                name: 'category',
                component: () => import('../view/category/index.vue')
            },
        ]
    }

]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router